define(function(require, exports, module){
	var productServiceTemp = require("text!../template/productService.html");

	module.exports = Nuui.View.extend({

		template:productServiceTemp,

		onRender:function(){
			var view = this;
            var index = sessionStorage.getItem("key");

            view.$('.smart-title a').on('tap', function(){
				var self = $(this);
				self.addClass('at-active').siblings().removeClass('at-active');
				return false;
			});

			var queryCollectList=function(){
				App.request(App.server.getServePath(App.path.enterpriseAction), {
				//data:"",
				success:function(data){
					if(data.ec){
                        alert(data.em);
					}else {
                       var businessIntroduction = data.brandInfo[index];
                       var productservice = data.productService[index];

                        var tpl= '<div id="productIntro">\n' +
                            '\t\t\t\t<img src="../../../images/img/'+businessIntroduction.logo+'" alt="">\n' +
                            '\t\t\t\t<div class="detail">\n' +
                            '\t\t\t\t\t<h1>'+businessIntroduction.title+'</h1>\n' +
                            '\t\t\t\t\t<div>'+businessIntroduction.indroduction+'</div>\n' +
                            '\t\t\t\t</div>\n' +
                            '\t\t\t</div>';

                        var tpl1='<div class="box">\n' +
                            '\t\t\t\t<div id="product_service">\n' +
                            '\t\t\t\t\t<div class="service_list">\n' +
                            '\t\t\t\t\t\t<img src="../../../images/img/'+productservice.img+'" alt="">\n' +
                            '\t\t\t\t\t\t<h1>'+productservice.title+'</h1>\n' +
                            '\t\t\t\t\t</div>\n' +
                            '\t\t\t\t</div>\n' +
                            '\t\t\t</div>';

                        view.$("#productService").html(tpl);
                        view.$('.smart-left').on('tap', function(){
                            view.$("#productService").html(tpl);
                            return false;
                        });
                        view.$('.smart-right').on('tap', function(){
                            view.$("#productService").html(tpl1);
                            return false;
                        });
                    }
					}
				});
			};
            queryCollectList();
		},

		onShow:function(){

		}
	});
});
